import { requestClient } from '#/api/request';


//查询 
export async function getUserListApi(params: any) {
  return requestClient.get('/system/get-user-list', { params });
}

// 添加
export async function addUserApi(data: any) {
  return requestClient.post('/system/add-user-list', data);
}

// 修改角色/密码
export async function updateUserAdminApi(data: any) {
  return requestClient.patch('/auth/update-user-password', data);
}

// 修改用户角色
export async function updateSystemUserAdminApi(data: any) {
  return requestClient.patch('/system/assignment-user-role', data);
}

// 重置密码
export async function resetUserPasswordApi(data: any) {
  return requestClient.post('/auth/admin-reset-password', data);
}

// 获取系统时间
export async function getSystemDateTimeApi() {
  return requestClient.get('/system/get-system-datetime');
}

// 更新用户信息
export async function updateUserInfoApi(data: { icon?: string; sex?: string }) {
  return requestClient.patch('/system/update-user-info', data);
}

// 验证用户手机号
export async function verifyUserPhoneApi(data: { phone: string; verificationCode: string }) {
  return requestClient.patch('/system/verify-user-phone', data);
}

// 修改用户手机号
export async function updateUserPhoneApi(data: { phone: string; verificationCode: string }) {
  return requestClient.patch('/system/update-user-phone', data);
}

// 验证用户邮箱
export async function verifyUserEmailApi(data: { email: string; verificationCode: string }) {
  return requestClient.patch('/system/verify-user-email', data);
}

// 修改用户邮箱
export async function updateUserEmailApi(data: { email: string; verificationCode: string }) {
  return requestClient.patch('/system/update-user-email', data);
}

// 根据角色名称获取用户信息
export async function getUserInfoByRoleApi(params: any) {
  return requestClient.get('/system/get-user-info-by-role-id', { params });
}

// 根据id获取用户信息
export async function getUserInfoByIdsApi(ids: any) {
  return requestClient.post('/system/get-user-info-by-ids', ids);
}
